<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>更换头像1</title>
    <link rel="stylesheet" href="/assets/lib/layui/css/layui.css">
    <link rel="stylesheet" href="/assets/lib/cropper/cropper.css">
    <link rel="stylesheet" href="/assets/css/user/user_avatar.css">
</head>

<body>
    <div class="layui-card">
        <div class="layui-card-header">更换头像</div>
        <div class="layui-card-body">
            <div id="avatar">
                <div class="avatar_box">
                    <div class="avatar_img">
                        <!-- 这个图片标签必须要有，要作为获取裁剪区域的主体存在 -->
                        <img src="/assets/images/sample.jpg" id="image">
                    </div>
                </div>
                <div class="preview_box">
                    <div>
                        <!-- 设置一个标签作为预览器的显示载体 -->
                        <div class="preview_image preview_big"></div>
                        <p class="size">100&nbsp;x&nbsp;100</p>
                    </div>
                    <div>
                        <!-- 设置一个标签作为预览器的显示载体 -->
                        <div class="preview_image  preview_little"> </div>
                        <p class="size">50&nbsp;x&nbsp;50</p>
                    </div>
                </div>
            </div>

            <div class="btn">
                <!-- accept属性规定允许用户可选择的文件格式 -->
                <input type="file" id="file" accept="image/png,image/jpeg">
                <button class="layui-btn" id="btnChooseImage">上传</button>
                <button class="layui-btn layui-btn-danger" id="uploadBtn">确定</button>
            </div>
        </div>
    </div>
    <!-- 按照如下顺序引入cropper插件的js文件 -->
    <script src="/assets/lib/jquery.js"></script>
    <!-- 导入layui的js文件 -->
    <script src="/assets/lib/layui/layui.all.js"></script>
    <script src="/assets/lib/cropper/Cropper.js"></script>
    <script src="/assets/lib/cropper/jquery-cropper.js"></script>
    <!-- 导入统一配置的baseAPI.js文件 -->
    <script src="/assets/js/baseAPI.js"></script>
    <script src="/assets/js/user/user_avatar.js"></script>
</body>

</html>